pp108 : fireSystemEvent Method

fireSystemEvent Method


This method fires the system event which can be used for event-based notifications between applications.

Syntax

system.fireSystemEvent(oData)

Parameters

Parameter

Description

oData

Optional. Variant that contains the data that can be passed to the page in which the event is caught. This can be used for notifications between applications.


Remarks


The fireSystemEvent method can be used for notification between two applications (as a broadcasting mechanism). The application that gets notified has to attach to theonsystemeventof the system behavior and the notifying application has to call thefireSystemEvent()method.

Consider the system event is defined in an application by the following syntax:

Scripting

//Fire the system event from the page required, with some data
var data = new Object();
data.busDataIsland = bdiEmployees;

//Fire the event
system.fireSystemEvent(data);

<!-- Attaching the function in onapplicationready event of the receiving page -->
<HTML onapplicationready="attachEvent()">

//Function definition - in the receiving page
function attachEvent()
{
    system.addListener("onsystemevent", handler);
}

//Handler for the system event
function handler(sEvent)
{
    if (sEvent &amp;&amp; sEvent.data)
    {
        application.notify("Data :  " + sEvent.data.busDataIsland);
    }
}


See Also


system